﻿using System.Web.Mvc;
using MvcContrib.PortableAreas;

namespace OpenIdPortableArea.Areas.OpenId
{
    /// <summary>
    ///     Registration for this Area.  Provides default routes.
    /// </summary>
    public class OpenIdAreaRegistration : PortableAreaRegistration
    {
        /// <summary>
        /// Registers the OpenId Area (which also includes embedded resources)
        /// </summary>
        /// <param name="context"></param>
        /// <param name="applicationBus"></param>
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus applicationBus)
        {
            RegisterRoutes(context);

            base.RegisterArea(context, applicationBus);
        }

        /// <summary>
        /// Registers routes specific to the OpenId area
        /// </summary>
        /// <param name="context"></param>
        public void RegisterRoutes(AreaRegistrationContext context)
        {
			context.MapRoute(
				"OpenId",
				"OpenId/{action}",
				new { controller = "OpenId", action = "Login" },
				new []{ "OpenIdPortableArea.Areas.OpenId.Controllers", "MvcContrib" }
			);
        }

        /// <summary>
        /// The name of the Area
        /// </summary>
        public override string AreaName
        {
            get { return "OpenId"; }
        }
    }
}